<?php

namespace app\index\controller;

use think\Controller;


class Index extends Controller
{

  public function index()
  {

    $cateList1=db('cate')->select();
  
    
    $this->assign('list',$cateList1);
   
   


    if(request()->isPost()){
      $name=input("user");
      $pwd=input("pwd");
      $user=db('admin')->where('username',$name)->select();
      if(!is_null($user)){
        if(md5($pwd)==$user[0]['password']){
         $this->success('登陆成功','release/release');
        }else{
          $this->success('账号或密码错误');
        }
      }
    }
    return $this->fetch('index');
  }
}
